<?php
	session_start();
	if ( isset( $_SESSION['auth'] ) )
	{
		$fp = @fsockopen( $_SESSION['ip'], $_SESSION['rport'], $errno, $errstr, 5);
		if ( !$fp ) exit( "OFF" );
		fwrite( $fp, $_SESSION['auth']." GETCHAT" );
		$len = fread( $fp, 1 );
		if ( $len != "0" )
		{
			$len = ord( $len );
			for ( $i = 0; $i < $len; $i++ )
			{
				$length = ord( fread( $fp, 1 ) );
				echo "<br/>".fread( $fp, $length );
			}
		}
		else echo "0";
		fclose( $fp );
	}
?>